﻿using System.ComponentModel.DataAnnotations;
using Microsoft.AspNetCore.Identity;

namespace JT.WEB.Areas.Identity.Data
{
    // Add profile data for application users by adding properties to the JTWEB3User class
    public class JTWEB3User : IdentityUser
    {
        [PersonalData]
        [Display(Name = "用户名")]
        //[RegularExpression(@"^\w+$", ErrorMessage = "必需是只包含 英文大小字母,数字,下划线")]
        //[Remote (action: "VerifyUserAsync", controller: "User")]
        public override string UserName { get; set; }
        [PersonalData]
        [Display(Name = "邮箱")]
        [EmailAddress(ErrorMessage = "请输入邮箱地址")]
        //[Required(ErrorMessage = "此项必填")]
        public override string Email { get; set; }
        [PersonalData]
        //[Required(ErrorMessage = "此项必填")]
        [StringLength(10, ErrorMessage = " {0} 的长度必需不小于 {2}", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "密码")]
        public string Password { get; set; }
        [PersonalData]
        [DataType(DataType.Password)]
        [Display(Name = "确认密码")]
        [StringLength(10, ErrorMessage = " {0} 的长度必需不小于 {2}", MinimumLength = 6)]
        [Compare("Password", ErrorMessage = "密码与确认密码不匹配")]
        public string ConfirmPassword { get; set; }
        [PersonalData]
        [StringLength(20, ErrorMessage = "呢称长度不能大于10个字.")]
        [RegularExpression(@"^[\u4E00-\u9FA5A-Za-z0-9]+$", ErrorMessage = "呢称由中文、英文、数字组成.")]
        [Display(Name = "呢称")]
        public string NickName { get; set; }
    }
}
